package com.ruoyi.core.service.impl;

import java.util.List;

import com.ruoyi.core.domain.ShippingAddresses;
import com.ruoyi.transaction.domain.Sku;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.core.mapper.MembersMapper;
import com.ruoyi.core.domain.Members;
import com.ruoyi.core.service.IMembersService;

/**
 * 会员信息Service业务层处理
 * 
 * @author 亢哲
 * @date 2025-08-07
 */
@Service
public class MembersServiceImpl implements IMembersService 
{
    @Autowired
    private MembersMapper membersMapper;

    @Override
    public List<ShippingAddresses> selectShippingAddressesByMembersId(Long membersId) {
        return membersMapper.selectShippingAddressesByMembersId(membersId);
    }

    @Override
    public List<Sku> selectSkuListByMembersId(Long membersId) {
        return membersMapper.selectSkuListByMembersId(membersId);
    }

    /**
     * 查询会员信息
     * 
     * @param id 会员信息主键
     * @return 会员信息
     */
    @Override
    public Members selectMembersById(Long id)
    {
        return membersMapper.selectMembersById(id);
    }

    /**
     * 查询会员信息列表
     * 
     * @param members 会员信息
     * @return 会员信息
     */
    @Override
    public List<Members> selectMembersList(Members members)
    {
        return membersMapper.selectMembersList(members);
    }

    /**
     * 新增会员信息
     * 
     * @param members 会员信息
     * @return 结果
     */
    @Override
    public int insertMembers(Members members)
    {
        return membersMapper.insertMembers(members);
    }

    /**
     * 修改会员信息
     * 
     * @param members 会员信息
     * @return 结果
     */
    @Override
    public int updateMembers(Members members)
    {
        return membersMapper.updateMembers(members);
    }

    /**
     * 批量删除会员信息
     * 
     * @param ids 需要删除的会员信息主键
     * @return 结果
     */
    @Override
    public int deleteMembersByIds(Long[] ids)
    {
        return membersMapper.deleteMembersByIds(ids);
    }

    /**
     * 删除会员信息信息
     * 
     * @param id 会员信息主键
     * @return 结果
     */
    @Override
    public int deleteMembersById(Long id)
    {
        return membersMapper.deleteMembersById(id);
    }


//    Sxz
    @Override
    public Members getMemberWithDetailsById(Long userId) {
        return membersMapper.selectMemberWithDetailsById(userId);
    }
}
